<template>
  <!-- 课程分类 -->
  <CourseCategory :courseCategoryList=courseCategoryList />
  <!-- 列表筛选 -->
  <CourseContent :ucfilter="ucfilter" />
</template>

<script lang="ts">
  import {defineComponent} from "vue";

  export default defineComponent({
    name: "LiveCourse"
  });
</script>

<script lang="ts" setup>
  import {onMounted, ref} from "vue";
  import {requestCourseCategory, courseCategoryType} from "@/api/courseAPI/videoCourseAPI";
  import CourseCategory from "../component/courseCategory";
  import CourseContent from "../component/courseContent";

  onMounted(() => {
    console.log("直播课挂载");
    getCourseCategory();
  });

  const courseCategoryList = ref<courseCategoryType[]>([]);

  //获取课程分类数据
  const getCourseCategory = async () => {
    const result = await requestCourseCategory("live_course");
    courseCategoryList.value = result;
  };

  const ucfilter = ref([
    {
      id: 1,
      title: "综合排序",
    }, {
      id: 2,
      title: "销量",
    }, {
      id: 3,
      title: "浏览量",
    }, {
      id: 4,
      title: "价格",
    }, {
      id: 5,
      title: "开课日期",
    }]);
</script>

<style lang="less">

</style>